package main

import (
	"fmt"
	"github.com/aliyun/aliyun-oss-go-sdk/oss"
	"os"
)

func main() {
	client, err := oss.New("https://oss-cn-qingdao.aliyuncs.com", "LTAI4FyEfkHw81UsWYn4QxvA", "UUWCQkcU6IXiNodpF8K59U8MGiovOk")
	if err != nil {
		fmt.Println("Error:", err)
		os.Exit(-1)
	}

	bucket, err := client.Bucket("huankai")
	if err != nil {
		panic(err)
	}

	/*err = bucket.PutObjectFromFile("mypic", "C:\\Users\\mayn\\Desktop\\1920x1080.jpg")
	if err != nil {
		panic(err)
	}*/

	err = bucket.GetObjectToFile("mypic", "C:\\Users")
	if err != nil {
		fmt.Println("Error:", err)
		os.Exit(-1)
	}
}
